/*
 * Copyright (C) 2011 The Code Bakers
 * Authors: Cleuton Sampaio e Francisco Rodrigues
 * e-mail: thecodebakers@gmail.com
 * Project: http://code.google.com/p/hercules-password-protector
 * Site: http://thecodebakers.blogspot.com
 *
 * Licensed under the GNU GPL, Version 3.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://gplv3.fsf.org/
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 * 
 * @author Cleuton Sampaio e Francisco Rogrigues - thecodebakers@gmail.com
 */

package br.com.thecodebakers.biomago.model;

import java.util.Date;

/**
 * This is a DTO for Biorithm information.
 * Esta é uma classe de transporte para o biorritmo de uma data.
 * @author cleuton
 *
 */
public class BioPlot implements Comparable {
	private Date data;
	private double intelectual;
	private double fisico; 
	private double emocional;
	
	public BioPlot() {
		super();
		this.data = new Date();
	}
	
	public BioPlot(Date data, double intelectual, double fisico,
			double emocional) {
		this();
		this.data = data;
		this.intelectual = intelectual;
		this.fisico = fisico;
		this.emocional = emocional;
	}
	
	public Date getData() {
		return data;
	}
	public void setData(Date data) {
		this.data = data;
	}
	public double getIntelectual() {
		return intelectual;
	}
	public void setIntelectual(double intelectual) {
		this.intelectual = intelectual;
	}
	public double getFisico() {
		return fisico;
	}
	public void setFisico(double fisico) {
		this.fisico = fisico;
	}
	public double getEmocional() {
		return emocional;
	}
	public void setEmocional(double emocional) {
		this.emocional = emocional;
	}

	@Override
	public boolean equals(Object o) {
		return this.getData().equals(((BioPlot) o).getData());
	}

	@Override
	public int hashCode() {
		return this.getData().toGMTString().hashCode();
	}

	@Override
	public String toString() {
		StringBuffer msg = new StringBuffer();
		msg.append("\r\nData: " + this.getData().toLocaleString());
		msg.append("\r\n\tEmocional: " + this.getEmocional());
		msg.append("\r\n\tFisico: " + this.getFisico());
		msg.append("\r\n\tIntelectual: " + this.getIntelectual());
		return msg.toString();
	}

	@Override
	public int compareTo(Object another) {
		return this.getData().compareTo(((BioPlot) another).getData());
	}
	
	
	
}
